﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LoanCalculator.Core;
using LoanCalculator.Core.Classes;
using LoanCalculator.Core.Interfaces;

namespace LoanCalculator.BusinessLogic.Payments
{
    public class PaymentService : ILoanCalculator
    {
        public PaymentService() { }

        public double CalculateMonthlyPayment(
                                            double loanAmount, double annualInterestRate, 
                                            double months, double downPayment, 
                                            double propertyTax, double propertyInsurance)
        {
            return new Loan(loanAmount, annualInterestRate, months, downPayment, propertyTax, propertyInsurance).CalculateMonthlyPayment();
        }

        public IList<Core.Classes.Payments> CalculateAmortization(
                                            double loanAmount, double annualInterestRate, 
                                            double months, double downPayment, 
                                            double propertyTax, double propertyInsurance)
        {
            return new Amortization(loanAmount, annualInterestRate, months, downPayment, propertyTax, propertyInsurance).GetAmortizationPayments();
        }
    }
}
